package czt.dm.service;

import czt.dm.entity.Student;
import czt.dm.mapper.CZTMapper;
import czt.dm.mapper.ZHMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CZTService {

    @Autowired
    private CZTMapper cztMapper;

    @Autowired
    private ZHMapper zhMapper;


    public void get() {
        List<Student> students = cztMapper.getStudents();
        System.out.println("students = " + students);
    }

    public void saveCzt() {
        Student student = new Student();
        student.setId("1");
        student.setName("czt");
        student.setAge(18);
        student.setClassName("高三1班");
        student.setGender("1");
        cztMapper.insert(student);
    }

    public void getZh() {
        List<Student> students = zhMapper.getStudents();
        System.out.println("students = " + students);
    }

    public void saveZh() {
        Student student = new Student();
        student.setId("1");
        student.setName("zh");
        student.setAge(18);
        student.setClassName("高三1班");
        student.setGender("2");
        zhMapper.insert(student);
    }
}
